﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerDataList.aspx.cs" Inherits="Induction.FinalTest.CustomerDataList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style id="Style1" runat="server" type="text/css">
        body {
	        font: 11px Verdana;
	        padding: 0px;
	        margin-left: 10px;
        }
    </style>
</head>
<body bgcolor="#cccccc">
    
    <form id="form1" runat="server">
    <asp:TextBox ID="SearchText" runat="server"></asp:TextBox>
    <asp:Button ID="SearchButton" runat="server" Text="Search" 
        onclick="SearchButton_Click" />
&nbsp;&nbsp;
    <asp:Label ID="Label1" runat="server" Font-Italic="True" 
        Text="(Search only available for Customer Number)"></asp:Label>
    <asp:Repeater ID="SearchRepeater" runat="server">
                <HeaderTemplate>
                    <table width="600px" border="1">
                        <tr>
                            <td><h3><b>Customer Number</b></h3></td>
                            <td><h3><b>Customer Name</b></h3></td>
                            <td><h3><b>Currency</b></h3></td>
                            <td><h3><b>Address 1</b></h3></td>
                            <td><h3><b>Phone Number</b></h3></td>
                            <td><h3><b>Email</b></h3></td>
                        </tr> 
                </HeaderTemplate>                   
                    <ItemTemplate>
                        
                        <tr>
                            <td><%# Eval("CustomerNumber")%></td>
                            <td><%# Eval("CustomerName")%></td>
                            <td><%# Eval("Currency")%></td>
                            <td><%# Eval("Address1")%></td>
                            <td><%# Eval("PhoneNumber") %></td>
                            <td><%# Eval("Email")%></td>
                         </tr>  
                    </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
    </asp:Repeater>
    <asp:ObjectDataSource ID="CustomerDataObject" runat="server">
    </asp:ObjectDataSource>
    <asp:Label ID="Label3" runat="server" Font-Size="Larger" 
        Text="Grid View Data Control"></asp:Label>
    <br />
    
    <asp:GridView ID="GridViewCustomerDetail" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" PageSize="5" 
        onpageindexchanging="GridViewCustomerDetail_PageIndexChanging">
        <Columns>
            <asp:TemplateField>
               <HeaderTemplate>
               <table border="1" widh=auto>
                    <tr>
                        <td>Customer Number</td>
                        <td>Customer Name</td>
                        <td>Currency</td>
                        <td>Address 1</td>
                        <td>Phone Number</td>
                        <td>Email</td>
                    </tr>
               </HeaderTemplate>
               <ItemTemplate>
                       <tr>
                            <td><%# Eval("CustomerNumber")%></td>
                            <td><%# Eval("CustomerName")%></td>
                            <td><%# Eval("Currency")%></td>
                            <td><%# Eval("Address1")%></td>
                            <td><%# Eval("PhoneNumber")%></td>
                            <td><%# Eval("Email")%></td>
                       </tr>                   
                </ItemTemplate>
               <FooterTemplate></table></FooterTemplate>                       
            </asp:TemplateField>           
        </Columns>
    </asp:GridView>    
    <br />
    <asp:Label ID="Label2" runat="server" Font-Size="Larger" 
        Text="Data List Data Control"></asp:Label>
    <asp:DataList ID="DataList1" runat="server" DataKeyField="CustomerNumber" 
        DataSourceID="ObjectDataSource1">
        <HeaderTemplate>
                    <table border="1">
                        <tr>
                            <td><h3><b>Customer Number</b></h3></td>
                            <td><h3><b>Customer Name</b></h3></td>
                            <td><h3><b>Currency</b></h3></td>
                            <td><h3><b>Address 1</b></h3></td>
                            <td><h3><b>Phone Number</b></h3></td>
                            <td><h3><b>Email</b></h3></td>
                        </tr> 
                </HeaderTemplate>                   
                    <ItemTemplate>
                        
                        <tr>
                            <td><%# Eval("CustomerNumber")%></td>
                            <td><%# Eval("CustomerName")%></td>
                            <td><%# Eval("Currency")%></td>
                            <td><%# Eval("Address1")%></td>
                            <td><%# Eval("PhoneNumber")%></td>
                            <td><%# Eval("Email")%></td>
                         </tr>  
                    </ItemTemplate>
         <FooterTemplate></table></FooterTemplate>
    </asp:DataList>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
        TypeName="Induction.FinalTest.GeneralDataSetTableAdapters.CustomersCountriesTableAdapter">
    </asp:ObjectDataSource>
    <br />
    <asp:Label ID="Label4" runat="server" Font-Size="Larger" 
        Text="List View Data Control"></asp:Label>
    <br />
    <asp:ListView ID="ListView1" runat="server" DataSourceID="ObjectDataSource2">
        <LayoutTemplate>
         <table border="1" cellpadding="1">
          <tr style="background-color:#E5E5FE">
           <th align="left">Customer Number</th>
           <th align="left">Customer Name</th>
           <th align="left">Currency</th>
           <th align="left">Address1</th>
           <th align="left">PhoneNumber</th>
           <th align="left">Email</th>
           
          </tr>
          <tr id="itemPlaceholder" runat="server"></tr>
         </table>
        </LayoutTemplate>
        <ItemTemplate>
          <tr>
           <td><asp:Label runat="server" ID="lblId"><%#Eval("CustomerNumber")%></asp:Label></td>
           <td><asp:Label runat="server" ID="lblName"><%#Eval("CustomerName")%></asp:Label></td>
           <td><asp:Label runat="server" ID="lblType"><%#Eval("Currency")%></asp:Label></td>
           <td><asp:Label runat="server" ID="Label6"><%#Eval("Address1")%></asp:Label></td>
           <td><asp:Label runat="server" ID="Label7"><%#Eval("PhoneNumber")%></asp:Label></td>
           <td><asp:Label runat="server" ID="Label5"><%#Eval("Email")%></asp:Label></td>
          </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
          <tr style="background-color:#EFEFEF">
           <td><asp:Label runat="server" ID="lblId"><%#Eval("CustomerNumber")%></asp:Label></td>
           <td><asp:Label runat="server" ID="lblName"><%#Eval("CustomerName")%></asp:Label></td>
           <td><asp:Label runat="server" ID="Label8"><%#Eval("Currency")%></asp:Label></td>
           <td><asp:Label runat="server" ID="Label9"><%#Eval("Address1")%></asp:Label></td>
           <td><asp:Label runat="server" ID="Label10"><%#Eval("PhoneNumber")%></asp:Label></td>
           <td><asp:Label runat="server" ID="lblType"><%#Eval("Email")%></asp:Label></td>
           
          </tr>
        </AlternatingItemTemplate>
    </asp:ListView>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
        TypeName="Induction.FinalTest.GeneralDataSetTableAdapters.CustomersCountriesTableAdapter">
    </asp:ObjectDataSource>
    <br />
    <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">[Add New Customer]</asp:LinkButton>
    </form>
    
</body>
</html>
